package com.example.javaserve.controller;

import com.example.javaserve.dto.AuthUsername;
import com.example.javaserve.dto.FilesPageInfoDto;
import com.example.javaserve.result.Result;
import com.example.javaserve.result.impl.SuccessResult;
import com.example.javaserve.service.FilesService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * @projectName: my_project
 * @package: com.example.javaserve.controller
 * @className: FilesController
 * @author: xxXPCSC
 * @description: TODO
 * @date: 2024/1/5 15:26
 * @version: 1.0
 **/
@RestController
public class FilesController {
    @Autowired
    private FilesService filesService;

    @PostMapping("/showFiles")
    public Result getFiles(@RequestBody FilesPageInfoDto filesPageInfoDto){
        System.out.println(filesPageInfoDto);
        return filesService.getFiles(filesPageInfoDto.getCurrentPage(),filesPageInfoDto.getSize());
    }
}
